package com.mall.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class ResultVO {
    private Integer code;
    private String msg;
    private Object data;
    public static ResultVO fail(){

        return new ResultVO(201,"服务器调用失败",null);
    }
    public static ResultVO fail(String msg){

        return new ResultVO(201,msg,null);
    }
    public static ResultVO fail(Integer code,String msg){

        return new ResultVO(code,msg,null);
    }
    public static ResultVO success(){

        return new ResultVO(200,"服务器调用成功！",null);
    }
    public static ResultVO success(Object data){

        return new ResultVO(200,"服务器调用成功！",data);
    }
    public static ResultVO success(String msg,Object data){

        return new ResultVO(200,msg,data);
    }

}
